<template>
  <el-card shadow="never">
    <div style="text-align: right">
      <el-tooltip class="item" effect="dark" content="新增" placement="top">
        <el-button size="small" class="mb10" type="primary" icon="el-icon-plus" @click="handleAdd" />
      </el-tooltip>
    </div>
    <position-table ref="positionTable" @edit="handleEdit" />
    <position-modal ref="positionModal" @refresh="handleRefresh" />
  </el-card>
</template>

<script>
import PositionTable from './PositionTable'
import PositionModal from './PositionModal'

export default {
  name: 'PositionIndex',
  components: {
    PositionTable,
    PositionModal
  },
  methods: {
    // 刷新表格
    handleRefresh() {
      this.$refs.positionTable.handleGetList()
    },
    // 新增
    handleAdd() {
      this.$refs.positionModal.eidt(false, {})
    },
    // 编辑
    handleEdit(row) {
      this.$refs.positionModal.eidt(true, row)
    }
  }
}
</script>
